package com.cwx.mychat.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cwx.mychat.entity.dto.TokenUserInfoDto;
import com.cwx.mychat.entity.po.GroupInfo;
import com.cwx.mychat.exception.BusinessException;
import com.cwx.mychat.utils.R;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

public interface GroupInfoService extends IService<GroupInfo> {
    /**
     * 新建群聊
     *
     * @param groupInfo
     */
    R saveGroup(GroupInfo groupInfo, MultipartFile file) throws BusinessException, IOException;

    /**
     * 更新群聊信息
     * @param groupInfo
     */
    void updateGroup(GroupInfo groupInfo) throws BusinessException;

    /**
     * 获取群组详情
     * @param groupId
     * @return
     */
    R getInfoById(String groupId) throws BusinessException;

    /**
     * 获取所有群组和好友
     * @param tokenUserInfoDto
     * @return
     */
    R getUserAndGroupList(TokenUserInfoDto tokenUserInfoDto);

    /**
     * 删除群组
     * @param groupId
     * @return
     */
    R deleteGroup(String groupId) throws BusinessException;

    /**
     * 获取群组的所有详情信息，包括备注，昵称，人员
     * @param groupId
     * @param userId
     * @return
     */
    R getGroupAllInfoById(String groupId, String userId) throws BusinessException;
}
